package org.zkdemo.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.zkdemo.result.Result;
import org.zkdemo.result.Status;

import akka.actor.ActorRef;

@RestController
public class TopologyController
{
    
    @Autowired
    private ActorRef core;
    
    @RequestMapping(value = "/manageIp", method = { RequestMethod.POST, RequestMethod.GET })
    public Result manageIps(@RequestParam(value = "ip") String ip)
    {
        core.tell(ip, null);
        
        return new Result(Status.OK, "Ok");
    }
}